home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Textfiles / zines / Midnight-Raid / MIDNIGHT_RAIDvol1iss3.docÉ.sit / MIDNIGHT_RAIDvol1iss3.docmaker.rsrc / TEXT_137.txt < prev    next >
Text File  |  1999-03-03  |  33KB  |  645 lines

  1. Networking with TCP/IP.
  2.  
  3.     Linux supports a full implementation of the TCP/IP (Transport Control
  4. Protocol/Internet Protocol) networking protocols. TCP/IP has become the most
  5. successful mechanism for networking computers worldwide. With Linux and an
  6. Ethernet card, you can network your machine to a local area network, or
  7. (with the proper network connections) to the Internet--the worldwide TCP/IP
  8. network.
  9.  
  10. Hooking up a small LAN of UNIX machines is easy. It simply requires an
  11. Ethernet controller in each machine and the appropriate Ethernet cables and
  12. other hardware. Or, if your business or university provides access to the
  13. Internet, you can easily add your Linux machine to this network.
  14.  
  15.       The current implementation of TCP/IP and related protocols for Linux
  16. is called ``NET-3,'' and before that, ``NET-2.'' This has no relationship to
  17. the so-called NET-2 release of BSD UNIX; instead, ``NET-3'' in this context
  18. means the second implementation of TCP/IP for Linux.
  19.  
  20.         Linux NET-3 also supports SLIP--Serial Line Internet Protocol and
  21. PPP--Point-to-Point Protocol. SLIP and PPP allow you to have dialup Internet
  22. access using a modem. If your business or university provides SLIP or PPP
  23. access, you can dial in to the SLIP or PPP server and put your machine on
  24. the Internet over the phone line. Alternately, if your Linux machine also
  25. has Ethernet access to the Internet, you can set up your Linux box as a SLIP
  26. or PPP server.
  27.  
  28. For complete information on setting up TCP/IP under Linux, we encourage you
  29. to read the Linux NET-3 HOWTO, available via anonymous FTP from
  30. sunsite.unc.edu. The NET-3 HOWTO is a complete guide to configuring TCP/IP,
  31. including Ethernet and SLIP or PPP connections, under Linux. The Linux
  32. Ethernet HOWTO is a related document that describes configuration of various
  33. Ethernet card drivers for Linux. The Linux Network Administrator's Guide,
  34. from the Linux Documentation Project, is also available. See Appendix A for
  35. more information on these documents.
  36.  
  37. Also of interest is the book TCP/IP Network Administration, by Craig Hunt.
  38. It contains complete information on using and configuring TCP/IP on UNIX
  39. systems.
  40.  
  41. TCP/IP Hardware requirements.
  42.  
  43.   You can use Linux TCP/IP without any networking hardware at
  44. all--configuring ``loopback'' mode allows you to talk to yourself. This is
  45. necessary for some applications and games which use the ``loopback'' network
  46. device.
  47.  
  48.       However, if you want to use Linux with an Ethernet TCP/IP network, you
  49. need an Ethernet card. Common cards such as the 3com 3c503, HP PCLAN (27245
  50. and 27xxx series), Western Digital WD80x3, and Novell NE2000/NE1000 are
  51. supported, as well as many more. See the Linux Ethernet and Hardware HOWTOs
  52. for details.
  53.  
  54. There are a few common situations that you should watch out concerning
  55. supported cards: 1) Several cards are support but offer shoddy performance
  56. or have other restrictions. Examples are the 3Com 3C501 which works but
  57. gives absolutely horrible performance and the Racal-Interlan NI6510 using
  58. the am7990 lance chip which doesn't work with more than 16 megabytes of RAM.
  59. In the same vein, many cards are NE1000/NE2000 compatible clones and can
  60. have various problems. See the Linux Ethernet HOWTO for a more complete
  61. discussion of Linux Ethernet hardware compatibility.
  62.  
  63. Linux also supports SLIP and PPP, which allows you to use a modem to access
  64. the Internet over the phone line. In this case, you'll need a modem
  65. compatible with your SLIP or PPP server--most servers require a 14.4bps
  66. V.32bis modem at a minimum . Performance is greatly improved with a 33.6bps
  67. or higher modem.
  68.  
  69. 6.1.1 Configuring TCP/IP on your system.
  70.  
  71.   In this section we're going to discuss how to configure an Ethernet TCP/IP
  72. connection on your system. Note that this method should work for many
  73. systems, but certainly not all. This discussion should be enough to get you
  74. on the right path to configuring the network parameters of your machine, but
  75. there are numerous caveats and fine details not mentioned here. We direct
  76. you to the Linux Network Administrators' Guide and the NET-3-HOWTO for more
  77. information.[gif]
  78.  
  79. First, we assume that you have a Linux system that has the TCP/IP software
  80. installed. This includes basic clients such as telnet and ftp, system
  81. administration commands such as ifconfig and route (usually found in /etc),
  82. and networking configuration files (such as /etc/hosts). The other
  83. Linux-related networking documents described above explain how to go about
  84. installing the Linux networking software if you do not have it already.
  85.  
  86. We also assume that your kernel has been configured and compiled with TCP/IP
  87. support enabled. See Section 4.9 for information on compiling your kernel.
  88. To enable networking, you must answer ``yes'' to the appropriate questions
  89. during the make config step, and rebuild the kernel.
  90.  
  91. Once this has been done, you must modify a number of configuration files
  92. used by NET-3. For the most part this is a simple procedure. Unfortunately,
  93. however, there is wide disagreement between Linux distributions as to where
  94. the various TCP/IP configuration files and support programs should go. Much
  95. of the time, they can be found in /etc, but in other cases may be found in
  96. /usr/etc, /usr/etc/inet, or other bizarre locations. In the worst case
  97. you'll have to use the find command to locate the files on your system. Also
  98. note that not all distributions keep the NET-3 configuration files and
  99. software in the same location--they may be spread across several
  100. directories.
  101.  
  102. The following information applies primarily to Ethernet connections. If
  103. you're planning to use SLIP or PPP, read this section to understand the
  104. concepts, and follow the more specific instructions in the following
  105. sections.
  106.  
  107. Your network configuration.
  108.  
  109.   Before you can configure TCP/IP, you need to determine the following
  110. information about your network setup. In most cases, your local network
  111. administrator can provide you with this information.
  112.  
  113.  
  114.    * IP address. This is the unique machine address in dotted-decimal
  115.      format. An example is 128.253.153.54. Your network admins will provide
  116.      you with this number.
  117.  
  118.      If you're only configuring loopback mode (i.e. no SLIP, no Ethernet
  119.      card, just TCP/IP connections to your own machine) then your IP address
  120.      is 127.0.0.1.
  121.  
  122.  
  123.    * Your network mask (``netmask''). This is a dotted quad, similar to the
  124.      IP address, which determines which portion of the IP address specifies
  125.      the subnetwork number, and which portion specifies the host on that
  126.      subnet. (If you're shaky on these TCP/IP networking terms, we suggest
  127.      reading some introductory material on network administration.) The
  128.      network mask is a pattern of bits, which when overlayed onto an address
  129.      on your network, will tell you which subnet that address lives on. This
  130.      is very important for routing, and if you find, for example, that you
  131.      can happily talk to people outside your network, but not to some people
  132.      within your network, there is a good chance that you have an incorrect
  133.      mask specified.
  134.  
  135.      Your network administrators will have chosen the netmask when the
  136.      network was designed, and therefore they should be able to supply you
  137.      with the correct mask to use. Most networks are class C subnetworks
  138.      which use 255.255.255.0 as their netmask. Class B networks use
  139.      255.255.0.0. The NET-3 code will automatically select a mask that
  140.      assumes no subnetting as a default if you do not specify one.
  141.  
  142.      This applies as well to the loopback port. Since the loopback port's
  143.      address is always 127.0.0.1, the netmask for this port is always
  144.      255.0.0.0. You can either specify this explicitly or rely on the
  145.      default mask.
  146.  
  147.  
  148.    * Your network address. This is your IP address masked bitwise-ANDed the
  149.      netmask. For example, if your netmask is 255.255.255.0, and your IP
  150.      address is 128.253.154.32, your network address is 128.253.154.0. With
  151.      a netmask of 255.255.0.0, this would be 128.253.0.0.
  152.  
  153.      If you're only using loopback, you don't have a network address.
  154.  
  155.  
  156.    * Your broadcast address. The broadcast address is used to broadcast
  157.      packets to every machine on your subnet. Therefore, if the host number
  158.      of machines on your subnet is given by the last byte of the IP address
  159.      (netmask 255.255.255.0), your broadcast address will be your network
  160.      address ORed with 0.0.0.255.
  161.  
  162.      For example, if your IP address is 128.253.154.32, and your netmask is
  163.      255.255.255.0, your broadcast address is 128.253.154.255.
  164.  
  165.      Note that for historical reasons, some networks are setup to use the
  166.      network address as the broadcast address, if you have any doubt, check
  167.      with your network administrators. (In many cases, it will suffice to
  168.      duplicate the network configuration of other machines on your subnet,
  169.      substituting your own IP address, of course.)
  170.  
  171.      If you're only using loopback, you don't have a broadcast address.
  172.  
  173.  
  174.    * Your gateway address. This is the address of the machine which is your
  175.      ``gateway'' to the outside world (i.e. machines not on your subnet). In
  176.      many cases the gateway machine has an IP address identical to yours but
  177.      with a ``.1'' as its host address; e.g., if your IP address is
  178.      128.253.154.32, your gateway might be 128.253.154.1. Your network
  179.      admins will provide you with the IP address of your gateway.
  180.  
  181.      In fact, you may have multiple gateways. A gateway is simply a machine
  182.      that lives on two different networks (has IP addresses on different
  183.      subnets), and routes packets between them. Many networks have a single
  184.      gateway to ``the outside world'' (the network directly adjacent to your
  185.      own), but in some cases you will have multiple gateways--one for each
  186.      adjacent network.
  187.  
  188.      If you're only using loopback, you don't have a gateway address. The
  189.      same is true if your network is isolated from all others.
  190.  
  191.  
  192.    * Your name server address. Most machines on the net have a name server
  193.      which translates host names into IP addresses for them. Your network
  194.      admins will tell you the address of your name server. You can also run
  195.      a server on your own machine by running named, in which case the name
  196.      server address is 127.0.0.1. Unless you absolutely must run your own
  197.      name server, we suggest using the one provided to you on the network
  198.      (if any). Configuration of named is another issue altogether; our
  199.      priority at this point is to get you talking to the network. You can
  200.      deal with name resolution issues later.
  201.  
  202.      If you're only using loopback, you don't have a name server address.
  203.  
  204. SLIP/PPP users: You may or may not require any of the above information,
  205. except for a name server address. When using SLIP, your IP address is
  206. usually determined in one of two ways: Either (a) you have a ``static'' IP
  207. address, which is the same every time you connect to the network, or (b) you
  208. have a ``dynamic'' IP address, which is allocated from a pool available
  209. addresses when you connect to the server. In the following section on SLIP
  210. configuration this is covered in more detail.
  211.  
  212. NET-3 supports full routing, multiple routes, subnetworking (at this stage
  213. on byte boundaries only), the whole nine yards. The above describes most
  214. basic TCP/IP configurations. Yours may be quite different: when in doubt,
  215. consult your local network gurus and check out the man pages for route and
  216. ifconfig. Configuring TCP/IP networks is very much beyond the scope of this
  217. book; the above should be enough to get most people started.
  218.  
  219. The networking rc files.
  220.  
  221.       rc files are systemwide configuration scripts executed at boot time by
  222. init, which start up all of the basic system daemons (such as sendmail,
  223. cron, etc.) and configure things such as the network parameters, system host
  224. name, and so on. rc files are usually found in the directory /etc/rc.d but
  225. on other systems may be in /etc. In general Slackware distributions use the
  226. files rc.inet1, etc. in /etc/rc.d whereas the RedHat distributions use a
  227. series of directories
  228.  
  229.           Here, we're going to describe the rc files used to configure
  230. TCP/IP. There are two of them: rc.inet1 and rc.inet2. rc.inet1 is used to
  231. configure the basic network parameters (such as IP addresses and routing
  232. information) and rc.inet2 fires up the TCP/IP daemons (telnetd, ftpd, and so
  233. forth).
  234.  
  235.         Many systems combine these two files into one, usually called
  236. rc.inet or rc.net. The names given to your rc files doesn't matter, as long
  237. as they perform the correct functions and are executed at boot time by init.
  238. To ensure this, you may need to edit /etc/inittab and uncomment lines to
  239. execute the appropriate rc file(s). In the worst case you will have to
  240. create the rc.inet1 and rc.inet2 files from scratch and add entries for them
  241. to /etc/inittab.
  242.  
  243. As we said, rc.inet1 configures the basic network interface. This includes
  244. your IP and network address, and the routing table information for your
  245. network. The routing tables are used to route outgoing (and incoming)
  246. network datagrams to other machines. On most simple configurations, you have
  247. three routes: One for sending packets to your own machine, another for
  248. sending packets to other machines on your network, and another for sending
  249. packets to machines outside of your network (through the gateway machine).
  250. Two programs are used to configure these parameters: ifconfig and route.
  251. Both of these are usually found in /etc.
  252.  
  253.         ifconfig is used for configuring the network device interface with
  254. the parameters that it requires to function, such as the IP address, network
  255. mask, broadcast address and the like. Route is used to create and modify
  256. entries in the routing table.
  257.  
  258.     For most configurations, an rc.inet1 file that looks like the following
  259. should work. You will, of course, have to edit this for your own system. Do
  260. not use the sample IP and network addresses listed here for your own system;
  261. they correspond to an actual machine on the Internet.
  262.  
  263. [tscreen6272]
  264.  
  265. Again, you may have to tweak this file somewhat to get it to work. The above
  266. should be sufficient for the majority of simple network configurations, but
  267. certainly not all.
  268.  
  269.       rc.inet2 starts up various servers used by the TCP/IP suite. The most
  270. important of these is inetd. Inetd sits in the background and listens to
  271. various network ports. When a machine tries to make a connection to a
  272. certain port (for example, the incoming telnet port), inetd forks off a copy
  273. of the appropriate daemon for that port (in the case of the telnet port,
  274. inetd starts in.telnetd). This is simpler than running many separate,
  275. standalone daemons (e.g., individual copies of telnetd, ftpd, and so
  276. forth)--inetd starts up the daemons only when they are needed.
  277.  
  278.         Syslogd is the system logging daemon--it accumulates log messages
  279. from various applications and stores them into log files based on the
  280. configuration information in /etc/syslogd.conf. routed is a server used to
  281. maintain dynamic routing information. When your system attempts to send
  282. packets to another network, it may require additional routing table entries
  283. in order to do so. routed takes care of manipulating the routing table
  284. without the need for user intervention.
  285.  
  286.     Our example rc.inet2, below, only starts up the bare minimum of servers.
  287. There are many other servers as well--many of which have to do with NFS
  288. configuration. When attempting to setup TCP/IP on your system, it's usually
  289. best to start with a minimal configuration and add more complex pieces (such
  290. as NFS) when you have things working.
  291.  
  292. Note that in the below file, we assume that all of the network daemons are
  293. held in /etc. As usual, edit this for your own configuration.
  294.  
  295.  
  296. [tscreen6302]
  297.  
  298.     Among the various additional servers that you may want to start in
  299. rc.inet2 is named. Named is a name server--it is responsible for translating
  300. (local) IP addresses to names, and vice versa. If you don't have a name
  301. server elsewhere on the network, or want to provide local machine names to
  302. other machines in your domain, it may be necessary to run named. (For most
  303. configurations it is not necessary, however.) Named configuration is
  304. somewhat complex and requires planning; we refer interested readers to a
  305. good book on TCP/IP network administration.
  306.  
  307. The /etc/hosts file.
  308.  
  309.     /etc/hosts contains a list of IP addresses and the host names that they
  310. correspond to. In general, /etc/hosts only contains entries for your local
  311. machine, and perhaps other ``important'' machines (such as your name server
  312. or gateway). Your local name server will provide address-to-name mappings
  313. for other machines on the network, transparently.
  314.  
  315. For example, if your machine is loomer.vpizza.com with the IP address
  316. 128.253.154.32, your /etc/hosts would look like:
  317. [tscreen6318]
  318. If you're only using loopback, the only line in /etc/hosts should be for
  319. 127.0.0.1, with both localhost and your host name after it.
  320.  
  321. The /etc/networks file.
  322.  
  323.     The /etc/networks file lists the names and addresses of your own, and
  324. other, networks. It is used by the route command, and allows you to specify
  325. a network by name, should you so desire.
  326.  
  327.   Every network you wish to add a route to using the route command
  328. (generally called from rc.inet1--see above) must have an entry in
  329. /etc/networks.
  330.  
  331. As an example,
  332. [tscreen6333]
  333.  
  334. The /etc/host.conf file.
  335.  
  336.     This file is used to specify how your system will resolve host names. It
  337. should contain the two lines:
  338. [tscreen6338]
  339. These lines tell the resolve libraries to first check the /etc/hosts file
  340. for any names to lookup, and then to ask the name server (if one is
  341. present). The multi entry allows you to have multiple IP addresses for a
  342. given machine name in /etc/hosts.
  343.  
  344. The /etc/resolv.conf file.
  345.  
  346.       This file configures the name resolver, specifying the address of your
  347. name server (if any) and your domain name. Your domain name is your
  348. fully-qualified host name (if you're a registered machine on the Internet,
  349. for example), with the host name chopped off. That is, if your full host
  350. name is loomer.vpizza.com, your domain name is just vpizza.com.
  351.  
  352. For example, if your machine is goober.norelco.com, and has a name server at
  353. the address 128.253.154.5, your /etc/resolv.conf would look like:
  354. [tscreen6351]
  355. You can specify more than one name server--each must have a nameserver line
  356. of its own in resolv.conf.
  357.  
  358. Setting your host name.
  359.  
  360.     You should set your system host name with the hostname command. This is
  361. usually called from /etc/rc or /etc/rc.local; simply search your system rc
  362. files to determine where it is invoked. For example, if your (full) host
  363. name is loomer.vpizza.com, edit the appropriate rc file to execute the
  364. command:
  365. [tscreen6364]
  366. Note that the hostname executable may not be found in /bin on your system.
  367.  
  368. Trying it out.
  369.  
  370.   Once you have all of these files set up, you should be able to reboot your
  371. new kernel and attempt to use the network. There are many places where
  372. things can go wrong, so it's a good idea to test individual aspects of the
  373. network configuration (e.g., it's probably not a good idea to test your
  374. network configuration by firing up Mosaic over a network-based X
  375. connection).
  376.  
  377.     You can use the netstat command to display your routing tables; this is
  378. usually the source of the most trouble. The netstat man page describes the
  379. exact syntax of this command in detail. In order to test network
  380. connectivity, we suggest using a client such as telnet to connect to
  381. machines both on your local subnetwork and external networks. This will help
  382. to narrow down the source of the problem. (For example, if you're unable to
  383. connect to local machines, but can connect to machines on other networks,
  384. more than likely there is a problem with your netmask and routing table
  385. configuration). You can also invoke the route command directly (as root) to
  386. play with the entries in your routing table.
  387.  
  388. You should also test network connectivity by specifying IP addresses
  389. directly, instead of host names. For example, if you have problems with the
  390. command
  391. [tscreen6377]
  392. the cause may be incorrect name server configuration. Try using the actual
  393. IP address of the machine in question; if that works, then you know your
  394. basic network setup is (more than likely) correct, and the problem lies in
  395. your specification of the name server address.
  396.  
  397. Debugging network configurations can be a difficult task, and we can't begin
  398. to cover it here. If you are unable to get help from a local guru we
  399. strongly suggest reading the Linux Network Administrators' Guide from the
  400. LDP.
  401.  
  402. 6.1.2 SLIP configuration.
  403.  
  404.         SLIP (Serial Line Internet Protocol) allows you to use TCP/IP over a
  405. serial line, be that a phone line, with a dialup modem, or a leased
  406. asynchronous line of some sort. Of course, to use SLIP you'll need access to
  407. a dial-in SLIP server in your area. Many universities and businesses provide
  408. SLIP access for a modest fee.
  409.  
  410.     There are two major SLIP-related programs available--dip and slattach.
  411. Both of these programs are used to initiate a SLIP connection over a serial
  412. device. It is necessary to use one of these programs in order to enable
  413. SLIP--it will not suffice to dial up the SLIP server (with a communications
  414. program such as kermit) and issue ifconfig and route commands. This is
  415. because dip and slattach issue a special ioctl() system call to seize
  416. control of the serial device to be used as a SLIP interface.
  417.  
  418. dip can be used to dial up a SLIP server, do some handshaking to login to
  419. the server (exchanging your username and password, for example) and then
  420. initiate the SLIP connection over the open serial line. slattach, on the
  421. other hand, does very little other than grab the serial device for use by
  422. SLIP. It is useful if you have a permanent line to your SLIP server and no
  423. modem dialup or handshaking is necessary to initiate the connection. Most
  424. dialup SLIP users should use dip, on the other hand.
  425.  
  426. dip can also be used to configure your Linux system as a SLIP server, where
  427. other machines can dial into your own and connect to the network through a
  428. secondary Ethernet connection on your machine. See the documentation and man
  429. pages for dip for more information on this procedure.
  430.  
  431.         SLIP is quite unlike Ethernet, in that there are only two machines
  432. on the ``network''--the SLIP host (that's you) and the SLIP server. For this
  433. reason, SLIP is often referred to as a ``point-to-point'' connection. A
  434. generalization of this idea, known as PPP (Point to Point Protocol) has also
  435. been implemented for Linux.
  436.  
  437. When you initiate a connection to a SLIP server, the SLIP server will give
  438. you an IP address based on (usually) one of two methods. Some SLIP servers
  439. allocate ``static'' IP addresses--in which case your IP address will be the
  440. same every time you connect to the server. However, many SLIP servers
  441. allocate IP addresses dynamically--in which case you receive a different IP
  442. address each time you connect. In general, the SLIP server will print the
  443. values of your IP and gateway addresses when you connect. dip is capable of
  444. reading these values from the output of the SLIP server login session and
  445. using them to configure the SLIP device.
  446.  
  447. Essentially, configuring a SLIP connection is just like configuring for
  448. loopback or ethernet. The main differences are discussed below. Read the
  449. previous section on configuring the basic TCP/IP files, and apply the
  450. changes described below.
  451.  
  452. Static IP address SLIP connections using dip.
  453.  
  454.         If you are using a static-allocation SLIP server, you may want to
  455. include entries for your IP address and host name in /etc/hosts. Also,
  456. configure these files listed in the above section: rc.inet2, host.conf, and
  457. resolv.conf.
  458.  
  459. Also, configure rc.inet1, as described above. However, you only want to
  460. execute ifconfig and route commands for the loopback device. If you use dip
  461. to connect to the SLIP server, it will execute the appropriate ifconfig and
  462. route commands for the SLIP device for you. (If you're using slattach, on
  463. the other hand, you will need to include ifconfig/route commands in rc.inet1
  464. for the SLIP device--see below.)
  465.  
  466. dip should configure your routing tables appropriately for the SLIP
  467. connection when you connect. In some cases, however, dip's behavior may not
  468. be correct for your configuration, and you'll have to run ifconfig or route
  469. commands by hand after connecting to the server with dip (this is most
  470. easily done from within a shell script that runs dip and immediately
  471. executes the appropriate configuration commands). Your gateway is, in most
  472. cases, the address of the SLIP server. You may know this address before
  473. hand, or the gateway address will be printed by the SLIP server when you
  474. connect. Your dip chat script (described below) can obtain this information
  475. from the SLIP server.
  476.  
  477. ifconfig may require use of the pointopoint argument, if dip doesn't
  478. configure the interface correctly. For example, if your SLIP server address
  479. is 128.253.154.2, and your IP address is 128.253.154.32, you may need to run
  480. the command
  481. [tscreen6437]
  482. as root, after connecting with dip. The man pages for ifconfig will come in
  483. handy.
  484.  
  485.     Note that SLIP device names used with the ifconfig and route commands
  486. are sl0, sl1 and so on (as opposed to eth0, eth1, etc. for Ethernet
  487. devices).
  488.  
  489. In Section 6.1.2, below, we explain how to configure dip to connect to the
  490. SLIP server.
  491.  
  492. Static IP address SLIP connections using slattach.
  493.  
  494.       If you have a leased line or cable running directly to your SLIP
  495. server, then there is no need to use dip to initiate a connection. slattach
  496. can be used to configure the SLIP device instead.
  497.  
  498. In this case, your /etc/rc.inet1 file should look something like the
  499. following:
  500. [tscreen6459]
  501.  
  502. slattach allocates the first unallocated SLIP device (sl0, sl1, etc.) to the
  503. serial line specified.
  504.  
  505. Note that the first parameter to slattach is the SLIP protocol to use. At
  506. present the only valid values are slip and cslip. Slip is regular SLIP, as
  507. you would expect, and cslip is SLIP with datagram header compression. In
  508. most cases you should use cslip; however, if you seem to be having problems
  509. with this, try slip.
  510.  
  511. If you have more than one SLIP interface then you will have routing
  512. considerations to make. You will have to decide what routes to add, and
  513. those decisions can only be made on the basis of the actual layout of your
  514. network connections. A book on TCP/IP network configuration, as well as the
  515. man pages to route, will be of use.
  516.  
  517. Dynamic IP address SLIP connections using dip.
  518.  
  519.       If your SLIP server allocates an IP address dynamically, then you
  520. certainly don't know your address in advance--therefore, you can't include
  521. an entry for it in /etc/hosts. (You should, however, include an entry for
  522. your host with the loopback address, 127.0.0.1.)
  523.  
  524. Many SLIP servers print your IP address (as well as the server's address)
  525. when you connect. For example, one type of SLIP server prints a string such
  526. as,
  527. [tscreen6477]
  528. dip can capture these numbers from the output of the server and use them to
  529. configure the SLIP device.
  530.  
  531. See page [gif] , above, for information on configuring your various TCP/IP
  532.  
  533. files for use with SLIP. Below, we explain how to configure dip to connect
  534. to the SLIP server.
  535.  
  536. Using dip.
  537.  
  538.  
  539.  
  540.     dip can simplify the process of connecting to a SLIP server, logging in,
  541. and configuring the SLIP device. Unless you have a leased line running to
  542. your SLIP server, dip is the way to go.
  543.  
  544.   To use dip, you'll need to write a ``chat script'' which contains a list
  545. of commands used to communicate with the SLIP server at login time. These
  546. commands can automatically send your user name/password to the server, as
  547. well as get information on your IP address from the server.
  548.  
  549. Here is an example dip chat script, for use with a dynamic IP address
  550. server. For static servers, you will need to set the variables $local and
  551. $remote to the values of your local IP address and server IP address,
  552. respectively, at the top of the script. See the dip man page for details.
  553.  
  554. [tscreen6494]
  555.  
  556. dip automatically executes ifconfig and route commands based on the values
  557. of the variables $local and $remote. Here, those variables are assigned
  558. using the get...remote command, which obtains text from the SLIP server and
  559. assigns it to the named variable.
  560.  
  561. If the ifconfig and route commands that dip runs for you don't work, you can
  562. either run the correct commands in a shell script after executing dip, or
  563. modify the source for dip itself. Running dip with the -v option will print
  564. debugging information while the connection is being set up, which should
  565. help you to determine where things might be going awry.
  566.  
  567. Now, in order to run dip and open the SLIP connection, you can use a command
  568. such as:
  569. [tscreen6510]
  570. Where the various dip files, and the chat script (mychat.dip), are stored in
  571. /etc/dip.
  572.  
  573. The above discussion should be enough to get you well on your way to talking
  574. to the network, either via Ethernet or SLIP. Again, we strongly suggest
  575. looking into a book on TCP/IP network configuration, especially if your
  576. network has any special routing considerations, other than those mentioned
  577. here.
  578.  
  579. Dial-up networking and PPP.
  580.  
  581.  
  582.  
  583. Linux supports a full implementation of the PPP (Point-to-Point) networking
  584. protocols. PPP is a mechanism for creating and running IP (the Internet
  585. Protocol) and other network protocols over a serial connection (using a
  586. null-modem cable), over a telnet established link or a link made using
  587. modems and telephone lines (and of course using digital lines such as ISDN).
  588. This section will only cover configuring PPP as a client connecting via an
  589. analog modem to a remote machine that provides PPP dialup service.
  590.  
  591. For complete information on setting up PPP under Linux, we encourage you to
  592. read the Linux PPP HOWTO, available via anonymous FTP from sunsite.unc.edu.
  593. The PPP HOWTO is a complete guide to configuring PPP, including modem, ISDN
  594. and null-modem cables, under Linux. Much of the information in this section
  595. was gleaned from this document. The Linux Network Administrator's Guide,
  596. from the Linux Documentation Project, is also available. See Appendix A for
  597. more information on these documents.
  598.  
  599. 6.2.1 What you need to get started.
  600.  
  601. We assume that your kernel has been configured and compiled with TCP/IP
  602. support enabled. See Section 4.9 for information on compiling your kernel.
  603. To enable networking, you must answer ``yes'' to the appropriate questions
  604. during the make config step, and rebuild the kernel. We also assume that ppp
  605. has been compiled and installed on your system as well. We assume that you
  606. are using a Linux 1.2.x kernel with the PPP 2.1.2 software or Linux
  607. 1.3.X/2.0.x and PPP 2.2.0. At the time of writing, the latest official
  608. version of PPP available for Linux is ppp-2.2f. Please see the kerneld
  609. mini-HOWTO if you plan to use modules to load ppp into your kernel. It is
  610. highly recommended that you use a version of the Linux kernel and the
  611. appropriate PPP version that are known to be stable together.
  612.  
  613. You should also read
  614.  
  615.    * the documentation that comes with the PPP package;
  616.    * the pppd and chat man pages; (use man chat and man pppd to explore
  617.      these)
  618.    * the Linux Network Administration Guide (NAG);
  619.    * the Net-2/3 HOWTO;
  620.    * Linux kernel documentation installed in /usr/src/linux/Documentation
  621.      when you install the Linux source code;
  622.    * The modem setup information page--see Modem Setup Information
  623.      (http://www.in.net/info/modems/index.html)
  624.    * The excellent Unix/Linux books published by O'Reilly and Associates.
  625.      See (O'Reilly and Associates On-Line catalog (http://www.ora.com/). If
  626.      you are new to Unix/Linux, run (don't walk) to your nearest computer
  627.      book shop and invest in a number of these immediately!
  628.    * The PPP-FAQ maintained by Al Longyear, available from
  629.      (ftp://sunsite.unc.edu/pub/Linux/docs/faqs; see Appendix B). This
  630.      contains a great deal of useful information in question/answer format
  631.      that is very useful when working out why PPP is not working (properly).
  632.  
  633. 6.2.2 An overview of the steps involved.
  634.  
  635. There are several steps to setting up your system to use PPP. We recommend
  636. that you read through all of these steps thoroughly before attempting to
  637. actually bring up a PPP connection. Each of these steps will be discussed in
  638. detail later.
  639.  
  640.   1. Make sure that TCP/IP support is compiled into your kernel.
  641.   2. Make sure that PPP support is compiled into your kernel either
  642.      statically or as a loadable module.
  643.   3. Make sure that PPP software is compiled and installed on your systems.
  644.   4. Make sure that you have a modem configured and installed/attached to
  645.      your computer and that you know which serial port